//
//  LZSearchCityHeaderView.m
//  laziz_Consumer
//
//  Created by xbn_iMac on 2016/12/29.
//  Copyright © 2016年 XBN. All rights reserved.
//

#import "LZSearchCityHeaderView.h"
#import "Masonry.h"

@interface LZSearchCityHeaderView ()

@property (nonatomic, strong) UILabel *label;

@end

@implementation LZSearchCityHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self configUI];
    }
    return self;
}

#pragma mark - private method

- (void)configUI {
    
    UIView *leftLine = [[UIView alloc] init];
    leftLine.backgroundColor = UIColorFromRGB(0x000000, 1);
    [self addSubview:leftLine];
    
    [leftLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(0);
        make.centerY.equalTo(0);
        make.width.equalTo(4);
        make.height.equalTo(21);
    }];
    
    self.label = [[UILabel alloc] init];
    self.label.backgroundColor = [UIColor clearColor];
    self.label.font = [UIFont systemFontOfSize:14];
    self.label.textColor = UIColorFromRGB(0x999999, 1);
    [self addSubview:self.label];
    
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(10);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.trailing.mas_lessThanOrEqualTo(-10);
    }];
    
    UIView *bottomLine = [[UIView alloc] init];
    bottomLine.backgroundColor = UIColorFromRGB(0xdddddd, 1);
    [self addSubview:bottomLine];
    
    [bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(10);
        make.trailing.equalTo(-10);
        make.bottom.equalTo(0);
        make.height.equalTo(0.5);
    }];

}

#pragma mark - public method 

- (void)setLabelText:(NSString*)aText {
    self.label.text = aText;
}

@end
